<!DOCTYPE html>
<html>
  <head>
     
    <meta charset="UTF-8">
    <title>Oracle Apex IR 多选批量处理后页面局部刷新 - 我的元宇宙</title>
    <link rel="shortcut icon" href="/static/img/icon.png">
    <link rel="icon" href="/static/img/icon.png" sizes="192x192"/>
    
<link rel="stylesheet" href="/static/kico.css">
<link rel="stylesheet" href="/static/hingle.css">

    
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/FortAwesome/Font-Awesome/css/font-awesome.min.css">

    <meta name="viewport" content="width=device-width, maximum-scale=1, initial-scale=1"/>
    <meta property="og:site_name" content="我的元宇宙">
    <meta property="og:title" content="Oracle Apex IR 多选批量处理后页面局部刷新"/>
    
 
<meta name="generator" content="Hexo 5.4.0"></head>

  <body>
    <header>
    <div class="head-title">
        <h4>我的元宇宙</h4>
    </div>
    <div class="head-action">
        <div class="toggle-btn"></div>
        <div class="light-btn"></div>
        <div class="search-btn"></div>
    </div>
    <form class="head-search" method="post">
        <input type="text" name="s" placeholder="搜索什么？">
    </form>
    <nav class="head-menu">
        <a href="/">首页</a>
        <div class="has-child">
            <a>分类</a>
            <div class="sub-menu">
                <a class="category-link" href="/categories/%E5%AD%A6%E4%B9%A0/">学习</a><a class="category-link" href="/categories/%E6%9D%82%E9%A1%B9/">杂项</a><a class="category-link" href="/categories/%E7%AC%94%E8%AE%B0/">笔记</a><a class="category-link" href="/categories/%E8%BD%AC%E8%BD%BD/">转载</a>
            </div>
        </div>
        
            <a href="/about">关于我</a>
        
    </nav>
</header>

    <main>
    <div class="wrap min">
        <section class="post-title">
            <h2>Oracle Apex IR 多选批量处理后页面局部刷新</h2>
            <div class="post-meta">
                <time class="date">2021.12.13</time>
            
                <span class="category"><a class="category-link" href="/categories/%E5%AD%A6%E4%B9%A0/">学习</a></span>
            
            </div>
        </section>
        <article class="post-content">
        
            <h1 id="Apex-IR-多选批量处理后页面局部刷新"><a href="#Apex-IR-多选批量处理后页面局部刷新" class="headerlink" title="Apex IR 多选批量处理后页面局部刷新"></a>Apex IR 多选批量处理后页面局部刷新</h1><h2 id="数据源sql"><a href="#数据源sql" class="headerlink" title="数据源sql"></a>数据源sql</h2><ol>
<li>创建复选框</li>
</ol>
<p><a target="_blank" rel="noopener" href="https://docs.oracle.com/en/database/oracle/application-express/19.2/aeapi/CHECKBOX2-Function.html#">apex_item文档</a></p>
<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">select</span> EMPNO,</span><br><span class="line">       ENAME,</span><br><span class="line">       APEX_ITEM.CHECKBOX2(<span class="number">1</span>,EMPNO) <span class="keyword">as</span>  CHECKBOX2,</span><br><span class="line">       JOB,</span><br><span class="line">       MGR,</span><br><span class="line">       HIREDATE,</span><br><span class="line">       SAL,</span><br><span class="line">       COMM,</span><br><span class="line">       DEPTNO,</span><br><span class="line">       DNAME,</span><br><span class="line">       LOC</span><br><span class="line">  <span class="keyword">from</span> EMP_DEPT_V</span><br></pre></td></tr></table></figure>
<ol start="2">
<li>设置全选</li>
</ol>
<p>CHECKBOX2列 列名<code>标题</code>设置为<br><code>&lt;input type=&quot;checkbox&quot; onclick=&quot;javascript:$f_CheckAll(this, this.checked, $(&#39;[name=f01]&#39;));&quot;&gt;</code></p>
<p>隐藏一切用户操作并取消<code>转义</code><br><img src="https://nuczmjfhvndrjhrfpqkcyeimmdrcsebw.oss-cn-shanghai.aliyuncs.com/jbfffurvdqmpvhukbzbsea/yFhj6SAd5WnBkZhbpC6Q.png/jbfffurvdqmpvhukbzbsea"></p>
<h2 id="设置Ajax回调"><a href="#设置Ajax回调" class="headerlink" title="设置Ajax回调"></a>设置Ajax回调</h2><ol>
<li>创建Ajax回调处理名字<code>GET_ID_INTO_COLL</code></li>
</ol>
<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">declare</span></span><br><span class="line">    l_exists <span class="type">boolean</span>;</span><br><span class="line"><span class="keyword">begin</span></span><br><span class="line"><span class="comment">/*</span></span><br><span class="line"><span class="comment">    l_exists := APEX_COLLECTION.COLLECTION_EXISTS(</span></span><br><span class="line"><span class="comment">            p_collection_name =&gt; &#x27;USER_CHOOSE_DATA_ID&#x27;);</span></span><br><span class="line"><span class="comment">    if not l_exists then</span></span><br><span class="line"><span class="comment">        APEX_COLLECTION.CREATE_OR_TRUNCATE_COLLECTION(</span></span><br><span class="line"><span class="comment">                p_collection_name =&gt; &#x27;USER_CHOOSE_DATA_ID&#x27;</span></span><br><span class="line"><span class="comment">            );</span></span><br><span class="line"><span class="comment">    end if;</span></span><br><span class="line"><span class="comment">    */</span></span><br><span class="line">    <span class="comment">-- 清空</span></span><br><span class="line">     APEX_COLLECTION.CREATE_OR_TRUNCATE_COLLECTION(</span><br><span class="line">                p_collection_name <span class="operator">=</span><span class="operator">&gt;</span> <span class="string">&#x27;USER_CHOOSE_DATA_ID&#x27;</span></span><br><span class="line">            );</span><br><span class="line">    <span class="comment">-- 插入前台传的值</span></span><br><span class="line">    <span class="keyword">FOR</span> i <span class="keyword">IN</span> <span class="number">1.</span>.APEX_APPLICATION.G_F01.COUNT</span><br><span class="line">        LOOP</span><br><span class="line">            APEX_COLLECTION.ADD_MEMBER(</span><br><span class="line">                    p_collection_name <span class="operator">=</span><span class="operator">&gt;</span> <span class="string">&#x27;USER_CHOOSE_DATA_ID&#x27;</span>,</span><br><span class="line">                    p_c001 <span class="operator">=</span><span class="operator">&gt;</span> APEX_APPLICATION.G_F01(i));</span><br><span class="line">        <span class="keyword">end</span> loop;</span><br><span class="line">    <span class="comment">-- 响应前台的请求</span></span><br><span class="line">         apex_json.open_object; <span class="comment">-- &#123;</span></span><br><span class="line">        apex_json.close_all; <span class="comment">-- &#125;</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="keyword">end</span>;</span><br></pre></td></tr></table></figure>
<p><img src="https://nuczmjfhvndrjhrfpqkcyeimmdrcsebw.oss-cn-shanghai.aliyuncs.com/jbfffurvdqmpvhukbzbsea/ccCe6DRdhHaXEZJ5cBWM.png/jbfffurvdqmpvhukbzbsea"></p>
<h2 id="设置动态操作"><a href="#设置动态操作" class="headerlink" title="设置动态操作"></a>设置动态操作</h2><ol>
<li>创建批量处理按钮设置<strong>重定向弹框页</strong>并设置两个动态事件(关闭对话框刷新,点击事件)</li>
</ol>
<p><a target="_blank" rel="noopener" href="https://docs.oracle.com/en/database/oracle/application-express/19.2/aexjs/apex.server.html">官网文档</a></p>
<p><a target="_blank" rel="noopener" href="https://content.dsp.co.uk/apex/forcing-apex_application-g_fx-values-into-session">参考博客文档</a></p>
<p><img src="https://nuczmjfhvndrjhrfpqkcyeimmdrcsebw.oss-cn-shanghai.aliyuncs.com/jbfffurvdqmpvhukbzbsea/YjzcEeGpWa4dMMkwTHeY.png/jbfffurvdqmpvhukbzbsea"></p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">// 获取选中的数据 并写入列表</span></span><br><span class="line"><span class="keyword">var</span> f01_arr = [];</span><br><span class="line">jQuery(<span class="string">&quot;input[name=f01]:checked&quot;</span>).each(</span><br><span class="line">    <span class="function"><span class="keyword">function</span> (<span class="params">i</span>) </span>&#123;</span><br><span class="line">        f01_arr[i] = $(<span class="built_in">this</span>).val();</span><br><span class="line">    &#125;</span><br><span class="line">)</span><br><span class="line"><span class="comment">// 同步请求后台将 选中的ID插进集合</span></span><br><span class="line">apex.server.process(<span class="string">&quot;GET_ID_INTO_COLL&quot;</span>, &#123;</span><br><span class="line">    <span class="attr">f01</span>: f01_arr</span><br><span class="line">&#125;, &#123;<span class="attr">async</span>: <span class="literal">false</span>, <span class="comment">// 一定要关闭异步</span></span><br><span class="line">    <span class="attr">success</span>: <span class="function"><span class="keyword">function</span>(<span class="params"> data </span>)  </span>&#123;</span><br><span class="line">        <span class="comment">// do something here</span></span><br><span class="line">    &#125;,</span><br><span class="line">    <span class="attr">error</span>: <span class="function"><span class="keyword">function</span>(<span class="params"> jqXHR, textStatus, errorThrown </span>) </span>&#123;</span><br><span class="line">        <span class="comment">// handle error</span></span><br><span class="line">    &#125;</span><br><span class="line">&#125; </span><br><span class="line">                   );</span><br></pre></td></tr></table></figure>

<h2 id="弹框页设置"><a href="#弹框页设置" class="headerlink" title="弹框页设置"></a>弹框页设置</h2><ol>
<li><p>查询选中的数据</p>
<blockquote>
<p>select C001<br>from APEX_COLLECTIONs where  collection_name =’USER_CHOOSE_DATA_ID’;</p>
</blockquote>
</li>
<li><p>页项</p>
</li>
</ol>
<p>根据自己的业务要求 此处省略 </p>
<ol start="3">
<li>批量处理</li>
</ol>
<p>根据自己的业务要求 此处省略 </p>
<ol start="4">
<li>设置对话框关闭处理</li>
</ol>
<p><img src="https://nuczmjfhvndrjhrfpqkcyeimmdrcsebw.oss-cn-shanghai.aliyuncs.com/jbfffurvdqmpvhukbzbsea/S6YPpPdHTdW84PMJJrye.png/jbfffurvdqmpvhukbzbsea"></p>

        </article>
        <section class="post-near">
            <ul>
                
                    <li>上一篇: <a href="/2022/01/13/6578eb87a21b/">Apex直传阿里云OSS</a></li>
                
                
                    <li>下一篇: <a href="/2021/11/05/60190b5049e6/">Apex上传文件至Windows网盘</a></li>
                
            </ul>
        </section>
        
            <section class="post-tags">
            <a class="-none-link" href="/tags/Apex/" rel="tag">Apex</a><a class="-none-link" href="/tags/CSS/" rel="tag">CSS</a><a class="-none-link" href="/tags/HTML/" rel="tag">HTML</a><a class="-none-link" href="/tags/JS/" rel="tag">JS</a><a class="-none-link" href="/tags/Oracle/" rel="tag">Oracle</a>
            </section>
        
    
        <section class="post-author">
        
            <figure class="author-avatar">
                <!-- <img src="https://metaverse-1256174970.cos.ap-shanghai.myqcloud.com/image_%2Fahmed-mulla-hS-2bYjeyWc-unsplash.jpg" alt="Pan" /> -->
                <img src="https://nuczmjfhvndrjhrfpqkcyeimmdrcsebw.oss-cn-shanghai.aliyuncs.com/jbfffurvdqmpvhukbzbsea/QPWp3GjspHEz8QHi6RDm.jpeg" alt="Pan" >
            </figure>
        
            <div class="author-info">
                <h4>Pan</h4>
                <p>社会主义螺丝钉,币圈韭菜,A股韭菜</p>
            </div>
        </section>
    
    </div>
</main>

    <footer>
    <div class="buttons">
        <a class="to-top" href="#"></a>
    </div>
    <div class="wrap min">
        <section class="widget">
            <div class="row">
                <div class="col-m-4">
                    <h3 class="title-recent">最新文章：</h3>
                    <ul class="post-list"><li class="post-list-item"><a class="post-list-link" href="/2022/05/01/0586406b1d50/">不同衣物收纳教程</a></li><li class="post-list-item"><a class="post-list-link" href="/2022/01/13/6578eb87a21b/">Apex直传阿里云OSS</a></li><li class="post-list-item"><a class="post-list-link" href="/2021/12/13/3449662a057f/">Oracle Apex IR 多选批量处理后页面局部刷新</a></li><li class="post-list-item"><a class="post-list-link" href="/2021/11/05/60190b5049e6/">Apex上传文件至Windows网盘</a></li><li class="post-list-item"><a class="post-list-link" href="/2021/11/05/b209999e9b35/">Apex对接钉钉免登</a></li><li class="post-list-item"><a class="post-list-link" href="/2021/11/05/e7f888284497/">Oracle AES加解密Demo</a></li></ul>
                </div>
                <div class="col-m-4">
                    <h3 class="title-date">时光机：</h3>
                    <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/archives/2022/05/">五月 2022</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2022/01/">一月 2022</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2021/12/">十二月 2021</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2021/11/">十一月 2021</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/06/">六月 2020</a></li></ul>
                </div>
                <div class="col-m-4">
                    <h3 class="title-tags">标签云：</h3>
                    <a href="/tags/AES/" style="font-size: 10px;">AES</a> <a href="/tags/Apex/" style="font-size: 16.67px;">Apex</a> <a href="/tags/CSS/" style="font-size: 10px;">CSS</a> <a href="/tags/HTML/" style="font-size: 10px;">HTML</a> <a href="/tags/JS/" style="font-size: 10px;">JS</a> <a href="/tags/Nginx/" style="font-size: 10px;">Nginx</a> <a href="/tags/OSS/" style="font-size: 10px;">OSS</a> <a href="/tags/Oracle/" style="font-size: 13.33px;">Oracle</a> <a href="/tags/Ords/" style="font-size: 10px;">Ords</a> <a href="/tags/PL-SQL/" style="font-size: 10px;">PL/SQL</a> <a href="/tags/SQLcl/" style="font-size: 10px;">SQLcl</a> <a href="/tags/Tomcat/" style="font-size: 10px;">Tomcat</a> <a href="/tags/Windows/" style="font-size: 10px;">Windows</a> <a href="/tags/%E5%85%83%E5%AE%87%E5%AE%99/" style="font-size: 20px;">元宇宙</a> <a href="/tags/%E5%A4%9C%E8%AF%BB/" style="font-size: 13.33px;">夜读</a> <a href="/tags/%E6%9D%82%E9%A1%B9/" style="font-size: 10px;">杂项</a> <a href="/tags/%E7%BD%91%E7%9B%98/" style="font-size: 10px;">网盘</a> <a href="/tags/%E8%BD%AC%E8%BD%BD/" style="font-size: 13.33px;">转载</a> <a href="/tags/%E9%92%89%E9%92%89/" style="font-size: 10px;">钉钉</a> <a href="/tags/%E9%98%BF%E9%87%8C%E4%BA%91/" style="font-size: 10px;">阿里云</a>
                </div>
            </div>
        </section>
        <section class="sub-footer">
            <p>友链:<a href="https://wangfanggang.com/" target="_blank">钢钢更新</a></p>
            <p><span>用于分享个人成长经历,日常状况.心情感悟,分享Apex开发经验,Python开发经验,Go等一系列学习笔记.作为网络知识储备.也会记录一些网络金句</span></p>
            <p>© 2022 
                <a href="/">我的元宇宙</a>. All Rights Reserved. Theme By 
                <a href="https://github.com/Dreamer-Paul/Hingle" target="_blank" rel="nofollow">Hingle</a>.
                <a target="_blank" rel="noopener" href="https://beian.miit.gov.cn/">豫ICP备19030991号</a></p>
        </section>
    </div>
    
</footer>


<script src="/static/kico.js"></script>
<script src="/static/hingle.js"></script>


<script>var hingle = new Paul_Hingle({"copyright":true,"night":true});</script>

  </body>
</html>
